import React from 'react'
import {Radio} from 'antd'

import {radioStyle} from '../../../constant/constant-style'
import { FormattedMessage } from 'react-intl'

const RadioGroup = Radio.Group

const SurveyQuiz = ({formItemLayout, FormItem, quiz}) => {
  const {choices = [], answer} = quiz
  return (<FormItem {...formItemLayout} label={<FormattedMessage id='选项' />}>
    <RadioGroup value={answer}>
      {choices.map((option, index) => {
        return (
          <Radio style={radioStyle} value={`${index}`} key={index} disabled>
            <span>{option.choice}</span>
          </Radio>
        )
      })}
    </RadioGroup>
  </FormItem>)
}

export default SurveyQuiz
